3.1.44 \(\int (c+d x) (a+b \coth (e+f x))^2 \, dx\) [44]

3.1.44.1 Optimal result
3.1.44.2 Mathematica [A] (verified)
3.1.44.3 Rubi [A] (verified)
3.1.44.4 Maple [B] (verified)
3.1.44.5 Fricas [B] (verification not implemented)
3.1.44.6 Sympy [F]
3.1.44.7 Maxima [A] (verification not implemented)
3.1.44.8 Giac [F]
3.1.44.9 Mupad [F(-1)]

3.1.44.1 Optimal result

Integrand size = 18, antiderivative size = 127 \[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=b^2 c x+\frac {1}{2} b^2 d x^2+\frac {a^2 (c+d x)^2}{2 d}-\frac {a b (c+d x)^2}{d}-\frac {b^2 (c+d x) \coth (e+f x)}{f}+\frac {2 a b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}+\frac {b^2 d \log (\sinh (e+f x))}{f^2}+\frac {a b d \operatorname {PolyLog}\left (2,e^{2 (e+f x)}\right )}{f^2} \]

output
b^2*c*x+1/2*b^2*d*x^2+1/2*a^2*(d*x+c)^2/d-a*b*(d*x+c)^2/d-b^2*(d*x+c)*coth 
(f*x+e)/f+2*a*b*(d*x+c)*ln(1-exp(2*f*x+2*e))/f+b^2*d*ln(sinh(f*x+e))/f^2+a 
*b*d*polylog(2,exp(2*f*x+2*e))/f^2
 
3.1.44.2 Mathematica [A] (verified)

Time = 7.22 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.72 \[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=\frac {(a+b \coth (e+f x))^2 \sinh (e+f x) \left (-2 b^2 f (c+d x) \cosh (e+f x)-\left (a^2+b^2\right ) (e+f x) (-2 c f+d (e-f x)) \sinh (e+f x)+2 b \left (\frac {a f^2 (c+d x)^2}{d}+b d (e+f x)+(b d+2 a f (c+d x)) \log \left (1-e^{-e-f x}\right )+(b d+2 a f (c+d x)) \log \left (1+e^{-e-f x}\right )-2 a d \operatorname {PolyLog}\left (2,-e^{-e-f x}\right )-2 a d \operatorname {PolyLog}\left (2,e^{-e-f x}\right )\right ) \sinh (e+f x)\right )}{2 f^2 (b \cosh (e+f x)+a \sinh (e+f x))^2} \]

input
Integrate[(c + d*x)*(a + b*Coth[e + f*x])^2,x]
 
output
((a + b*Coth[e + f*x])^2*Sinh[e + f*x]*(-2*b^2*f*(c + d*x)*Cosh[e + f*x] - 
 (a^2 + b^2)*(e + f*x)*(-2*c*f + d*(e - f*x))*Sinh[e + f*x] + 2*b*((a*f^2* 
(c + d*x)^2)/d + b*d*(e + f*x) + (b*d + 2*a*f*(c + d*x))*Log[1 - E^(-e - f 
*x)] + (b*d + 2*a*f*(c + d*x))*Log[1 + E^(-e - f*x)] - 2*a*d*PolyLog[2, -E 
^(-e - f*x)] - 2*a*d*PolyLog[2, E^(-e - f*x)])*Sinh[e + f*x]))/(2*f^2*(b*C 
osh[e + f*x] + a*Sinh[e + f*x])^2)
 
3.1.44.3 Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 4205, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (c+d x) (a+b \coth (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (c+d x) \left (a-i b \tan \left (i e+i f x+\frac {\pi }{2}\right )\right )^2dx\)

\(\Big \downarrow \) 4205

\(\displaystyle \int \left (a^2 (c+d x)+2 a b (c+d x) \coth (e+f x)+b^2 (c+d x) \coth ^2(e+f x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^2 (c+d x)^2}{2 d}+\frac {2 a b (c+d x) \log \left (1-e^{2 (e+f x)}\right )}{f}-\frac {a b (c+d x)^2}{d}+\frac {a b d \operatorname {PolyLog}\left (2,e^{2 (e+f x)}\right )}{f^2}-\frac {b^2 (c+d x) \coth (e+f x)}{f}+\frac {b^2 (c+d x)^2}{2 d}+\frac {b^2 d \log (\sinh (e+f x))}{f^2}\)

input
Int[(c + d*x)*(a + b*Coth[e + f*x])^2,x]
 
output
(a^2*(c + d*x)^2)/(2*d) - (a*b*(c + d*x)^2)/d + (b^2*(c + d*x)^2)/(2*d) - 
(b^2*(c + d*x)*Coth[e + f*x])/f + (2*a*b*(c + d*x)*Log[1 - E^(2*(e + f*x)) 
])/f + (b^2*d*Log[Sinh[e + f*x]])/f^2 + (a*b*d*PolyLog[2, E^(2*(e + f*x))] 
)/f^2
 

3.1.44.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4205
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 
3.1.44.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(317\) vs. \(2(123)=246\).

Time = 0.39 (sec) , antiderivative size = 318, normalized size of antiderivative = 2.50

method result size
risch \(\frac {a^{2} d \,x^{2}}{2}-a b d \,x^{2}+\frac {b^{2} d \,x^{2}}{2}+a^{2} c x +2 a b c x +b^{2} c x -\frac {2 \left (d x +c \right ) b^{2}}{f \left ({\mathrm e}^{2 f x +2 e}-1\right )}+\frac {b^{2} d \ln \left ({\mathrm e}^{f x +e}-1\right )}{f^{2}}+\frac {b^{2} d \ln \left (1+{\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {2 b^{2} d \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {2 b a c \ln \left ({\mathrm e}^{f x +e}-1\right )}{f}+\frac {2 b a c \ln \left (1+{\mathrm e}^{f x +e}\right )}{f}-\frac {4 b a c \ln \left ({\mathrm e}^{f x +e}\right )}{f}-\frac {2 b e d a \ln \left ({\mathrm e}^{f x +e}-1\right )}{f^{2}}+\frac {4 b e d a \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {4 b d a e x}{f}-\frac {2 b d a \,e^{2}}{f^{2}}+\frac {2 b d a \ln \left (1-{\mathrm e}^{f x +e}\right ) x}{f}+\frac {2 b d a \ln \left (1-{\mathrm e}^{f x +e}\right ) e}{f^{2}}+\frac {2 b d a \operatorname {polylog}\left (2, {\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {2 b d a \ln \left (1+{\mathrm e}^{f x +e}\right ) x}{f}+\frac {2 b d a \operatorname {polylog}\left (2, -{\mathrm e}^{f x +e}\right )}{f^{2}}\) \(318\)

input
int((d*x+c)*(a+b*coth(f*x+e))^2,x,method=_RETURNVERBOSE)
 
output
1/2*a^2*d*x^2-a*b*d*x^2+1/2*b^2*d*x^2+a^2*c*x+2*a*b*c*x+b^2*c*x-2/f*(d*x+c 
)*b^2/(exp(2*f*x+2*e)-1)+1/f^2*b^2*d*ln(exp(f*x+e)-1)+1/f^2*b^2*d*ln(1+exp 
(f*x+e))-2/f^2*b^2*d*ln(exp(f*x+e))+2/f*b*a*c*ln(exp(f*x+e)-1)+2/f*b*a*c*l 
n(1+exp(f*x+e))-4/f*b*a*c*ln(exp(f*x+e))-2/f^2*b*e*d*a*ln(exp(f*x+e)-1)+4/ 
f^2*b*e*d*a*ln(exp(f*x+e))-4/f*b*d*a*e*x-2/f^2*b*d*a*e^2+2/f*b*d*a*ln(1-ex 
p(f*x+e))*x+2/f^2*b*d*a*ln(1-exp(f*x+e))*e+2/f^2*b*d*a*polylog(2,exp(f*x+e 
))+2/f*b*d*a*ln(1+exp(f*x+e))*x+2/f^2*b*d*a*polylog(2,-exp(f*x+e))
 
3.1.44.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 851 vs. \(2 (122) = 244\).

Time = 0.26 (sec) , antiderivative size = 851, normalized size of antiderivative = 6.70 \[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=-\frac {{\left (a^{2} - 2 \, a b + b^{2}\right )} d f^{2} x^{2} + 4 \, a b d e^{2} + 2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} c f^{2} x - 4 \, b^{2} d e - {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} d f^{2} x^{2} + 4 \, a b d e^{2} - 8 \, a b c e f - 4 \, b^{2} d e - 2 \, {\left (2 \, b^{2} d f - {\left (a^{2} - 2 \, a b + b^{2}\right )} c f^{2}\right )} x\right )} \cosh \left (f x + e\right )^{2} - 2 \, {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} d f^{2} x^{2} + 4 \, a b d e^{2} - 8 \, a b c e f - 4 \, b^{2} d e - 2 \, {\left (2 \, b^{2} d f - {\left (a^{2} - 2 \, a b + b^{2}\right )} c f^{2}\right )} x\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) - {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} d f^{2} x^{2} + 4 \, a b d e^{2} - 8 \, a b c e f - 4 \, b^{2} d e - 2 \, {\left (2 \, b^{2} d f - {\left (a^{2} - 2 \, a b + b^{2}\right )} c f^{2}\right )} x\right )} \sinh \left (f x + e\right )^{2} - 4 \, {\left (2 \, a b c e - b^{2} c\right )} f - 4 \, {\left (a b d \cosh \left (f x + e\right )^{2} + 2 \, a b d \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + a b d \sinh \left (f x + e\right )^{2} - a b d\right )} {\rm Li}_2\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right ) - 4 \, {\left (a b d \cosh \left (f x + e\right )^{2} + 2 \, a b d \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + a b d \sinh \left (f x + e\right )^{2} - a b d\right )} {\rm Li}_2\left (-\cosh \left (f x + e\right ) - \sinh \left (f x + e\right )\right ) + 2 \, {\left (2 \, a b d f x + 2 \, a b c f + b^{2} d - {\left (2 \, a b d f x + 2 \, a b c f + b^{2} d\right )} \cosh \left (f x + e\right )^{2} - 2 \, {\left (2 \, a b d f x + 2 \, a b c f + b^{2} d\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) - {\left (2 \, a b d f x + 2 \, a b c f + b^{2} d\right )} \sinh \left (f x + e\right )^{2}\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) + 1\right ) - 2 \, {\left (2 \, a b d e - 2 \, a b c f - b^{2} d - {\left (2 \, a b d e - 2 \, a b c f - b^{2} d\right )} \cosh \left (f x + e\right )^{2} - 2 \, {\left (2 \, a b d e - 2 \, a b c f - b^{2} d\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) - {\left (2 \, a b d e - 2 \, a b c f - b^{2} d\right )} \sinh \left (f x + e\right )^{2}\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) - 1\right ) + 4 \, {\left (a b d f x + a b d e - {\left (a b d f x + a b d e\right )} \cosh \left (f x + e\right )^{2} - 2 \, {\left (a b d f x + a b d e\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) - {\left (a b d f x + a b d e\right )} \sinh \left (f x + e\right )^{2}\right )} \log \left (-\cosh \left (f x + e\right ) - \sinh \left (f x + e\right ) + 1\right )}{2 \, {\left (f^{2} \cosh \left (f x + e\right )^{2} + 2 \, f^{2} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + f^{2} \sinh \left (f x + e\right )^{2} - f^{2}\right )}} \]

input
integrate((d*x+c)*(a+b*coth(f*x+e))^2,x, algorithm="fricas")
 
output
-1/2*((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 + 2*(a^2 - 2*a*b + b^2)* 
c*f^2*x - 4*b^2*d*e - ((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b 
*c*e*f - 4*b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*cosh(f*x 
 + e)^2 - 2*((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b*c*e*f - 4 
*b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*cosh(f*x + e)*sinh 
(f*x + e) - ((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b*c*e*f - 4 
*b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*sinh(f*x + e)^2 - 
4*(2*a*b*c*e - b^2*c)*f - 4*(a*b*d*cosh(f*x + e)^2 + 2*a*b*d*cosh(f*x + e) 
*sinh(f*x + e) + a*b*d*sinh(f*x + e)^2 - a*b*d)*dilog(cosh(f*x + e) + sinh 
(f*x + e)) - 4*(a*b*d*cosh(f*x + e)^2 + 2*a*b*d*cosh(f*x + e)*sinh(f*x + e 
) + a*b*d*sinh(f*x + e)^2 - a*b*d)*dilog(-cosh(f*x + e) - sinh(f*x + e)) + 
 2*(2*a*b*d*f*x + 2*a*b*c*f + b^2*d - (2*a*b*d*f*x + 2*a*b*c*f + b^2*d)*co 
sh(f*x + e)^2 - 2*(2*a*b*d*f*x + 2*a*b*c*f + b^2*d)*cosh(f*x + e)*sinh(f*x 
 + e) - (2*a*b*d*f*x + 2*a*b*c*f + b^2*d)*sinh(f*x + e)^2)*log(cosh(f*x + 
e) + sinh(f*x + e) + 1) - 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d - (2*a*b*d*e - 
2*a*b*c*f - b^2*d)*cosh(f*x + e)^2 - 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d)*cos 
h(f*x + e)*sinh(f*x + e) - (2*a*b*d*e - 2*a*b*c*f - b^2*d)*sinh(f*x + e)^2 
)*log(cosh(f*x + e) + sinh(f*x + e) - 1) + 4*(a*b*d*f*x + a*b*d*e - (a*b*d 
*f*x + a*b*d*e)*cosh(f*x + e)^2 - 2*(a*b*d*f*x + a*b*d*e)*cosh(f*x + e)*si 
nh(f*x + e) - (a*b*d*f*x + a*b*d*e)*sinh(f*x + e)^2)*log(-cosh(f*x + e)...
 
3.1.44.6 Sympy [F]

\[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=\int \left (a + b \coth {\left (e + f x \right )}\right )^{2} \left (c + d x\right )\, dx \]

input
integrate((d*x+c)*(a+b*coth(f*x+e))**2,x)
 
output
Integral((a + b*coth(e + f*x))**2*(c + d*x), x)
 
3.1.44.7 Maxima [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 244, normalized size of antiderivative = 1.92 \[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=\frac {1}{2} \, a^{2} d x^{2} - 2 \, a b d x^{2} + a^{2} c x - \frac {2 \, b^{2} d x}{f} + \frac {2 \, a b c \log \left (\sinh \left (f x + e\right )\right )}{f} + \frac {2 \, {\left (f x \log \left (e^{\left (f x + e\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (f x + e\right )}\right )\right )} a b d}{f^{2}} + \frac {2 \, {\left (f x \log \left (-e^{\left (f x + e\right )} + 1\right ) + {\rm Li}_2\left (e^{\left (f x + e\right )}\right )\right )} a b d}{f^{2}} + \frac {b^{2} d \log \left (e^{\left (f x + e\right )} + 1\right )}{f^{2}} + \frac {b^{2} d \log \left (e^{\left (f x + e\right )} - 1\right )}{f^{2}} - \frac {2 \, {\left (c f + 2 \, d\right )} b^{2} x + 4 \, b^{2} c + {\left (2 \, a b d f + b^{2} d f\right )} x^{2} - {\left (2 \, b^{2} c f x e^{\left (2 \, e\right )} + {\left (2 \, a b d f e^{\left (2 \, e\right )} + b^{2} d f e^{\left (2 \, e\right )}\right )} x^{2}\right )} e^{\left (2 \, f x\right )}}{2 \, {\left (f e^{\left (2 \, f x + 2 \, e\right )} - f\right )}} \]

input
integrate((d*x+c)*(a+b*coth(f*x+e))^2,x, algorithm="maxima")
 
output
1/2*a^2*d*x^2 - 2*a*b*d*x^2 + a^2*c*x - 2*b^2*d*x/f + 2*a*b*c*log(sinh(f*x 
 + e))/f + 2*(f*x*log(e^(f*x + e) + 1) + dilog(-e^(f*x + e)))*a*b*d/f^2 + 
2*(f*x*log(-e^(f*x + e) + 1) + dilog(e^(f*x + e)))*a*b*d/f^2 + b^2*d*log(e 
^(f*x + e) + 1)/f^2 + b^2*d*log(e^(f*x + e) - 1)/f^2 - 1/2*(2*(c*f + 2*d)* 
b^2*x + 4*b^2*c + (2*a*b*d*f + b^2*d*f)*x^2 - (2*b^2*c*f*x*e^(2*e) + (2*a* 
b*d*f*e^(2*e) + b^2*d*f*e^(2*e))*x^2)*e^(2*f*x))/(f*e^(2*f*x + 2*e) - f)
 
3.1.44.8 Giac [F]

\[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=\int { {\left (d x + c\right )} {\left (b \coth \left (f x + e\right ) + a\right )}^{2} \,d x } \]

input
integrate((d*x+c)*(a+b*coth(f*x+e))^2,x, algorithm="giac")
 
output
integrate((d*x + c)*(b*coth(f*x + e) + a)^2, x)
 
3.1.44.9 Mupad [F(-1)]

Timed out. \[ \int (c+d x) (a+b \coth (e+f x))^2 \, dx=\int {\left (a+b\,\mathrm {coth}\left (e+f\,x\right )\right )}^2\,\left (c+d\,x\right ) \,d x \]

input
int((a + b*coth(e + f*x))^2*(c + d*x),x)
 
output
int((a + b*coth(e + f*x))^2*(c + d*x), x)